package sk.fiit.icp.data;

// Generated Nov 27, 2011 12:56:29 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Events generated by hbm2java
 */
@Entity
@Table(name = "events", catalog = "icp")
public class Events implements java.io.Serializable {

	private Integer idevent;
	private Repetition repetition;
	private Events events;
	private Users users;
	private EventCategories eventCategories;
	private String title;
	private Date startTime;
	private Date endTime;
	private String text;
	private int allDayEvent;
	private int progress;
	private int priority;
	private int archive;
	private String location;
	private Set<Events> eventses = new HashSet<Events>(0);

	public Events() {
	}

	public Events(Repetition repetition, Users users, EventCategories eventCategories, String title, Date startTime,
			Date endTime, int allDayEvent, int progress, int priority, int archive) {
		this.repetition = repetition;
		this.users = users;
		this.eventCategories = eventCategories;
		this.title = title;
		this.startTime = startTime;
		this.endTime = endTime;
		this.allDayEvent = allDayEvent;
		this.progress = progress;
		this.priority = priority;
		this.archive = archive;
	}

	public Events(Repetition repetition, Events events, Users users, EventCategories eventCategories, String title,
			Date startTime, Date endTime, String text, int allDayEvent, int progress, int priority, int archive,
			String location, Set<Events> eventses) {
		this.repetition = repetition;
		this.events = events;
		this.users = users;
		this.eventCategories = eventCategories;
		this.title = title;
		this.startTime = startTime;
		this.endTime = endTime;
		this.text = text;
		this.allDayEvent = allDayEvent;
		this.progress = progress;
		this.priority = priority;
		this.archive = archive;
		this.location = location;
		this.eventses = eventses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "IDEvent", unique = true, nullable = false)
	public Integer getIdevent() {
		return this.idevent;
	}

	public void setIdevent(Integer idevent) {
		this.idevent = idevent;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "repetitionid", nullable = false)
	public Repetition getRepetition() {
		return this.repetition;
	}

	public void setRepetition(Repetition repetition) {
		this.repetition = repetition;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "parentId")
	public Events getEvents() {
		return this.events;
	}

	public void setEvents(Events events) {
		this.events = events;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "userId", nullable = false)
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "categoryId", nullable = false)
	public EventCategories getEventCategories() {
		return this.eventCategories;
	}

	public void setEventCategories(EventCategories eventCategories) {
		this.eventCategories = eventCategories;
	}

	@Column(name = "title", nullable = false)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "startTime", nullable = false, length = 19)
	public Date getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "endTime", nullable = false, length = 19)
	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name = "text", length = 65535)
	public String getText() {
		return this.text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Column(name = "allDayEvent", nullable = false)
	public int getAllDayEvent() {
		return this.allDayEvent;
	}

	public void setAllDayEvent(int allDayEvent) {
		this.allDayEvent = allDayEvent;
	}

	@Column(name = "progress", nullable = false)
	public int getProgress() {
		return this.progress;
	}

	public void setProgress(int progress) {
		this.progress = progress;
	}

	@Column(name = "priority", nullable = false)
	public int getPriority() {
		return this.priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	@Column(name = "archive", nullable = false)
	public int getArchive() {
		return this.archive;
	}

	public void setArchive(int archive) {
		this.archive = archive;
	}

	@Column(name = "location", length = 65535)
	public String getLocation() {
		return this.location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	@OneToMany(mappedBy = "events")
	public Set<Events> getEventses() {
		return this.eventses;
	}

	public void setEventses(Set<Events> eventses) {
		this.eventses = eventses;
	}

}
